from django.urls import path
from . import views

app_name = 'accounts'

urlpatterns = [
    # 认证相关
    path('register', views.register, name='register'),
    path('login', views.login, name='login'),
    path('send-code', views.send_verification_code, name='send_verification_code'),
    path('email-login', views.email_code_login, name='email_code_login'),
    path('reset-password', views.reset_password, name='reset_password'),
    path('logout', views.logout, name='logout'),
    path('me', views.get_current_user, name='current_user'),
    path('refresh', views.refresh_token, name='refresh_token'),
    path('profile/', views.update_current_user_profile, name='update_current_user_profile'),  # 更新当前用户资料
    
    # 用户管理
    path('', views.get_user_list, name='user_list'),  # 获取用户列表（管理员）
    path('<int:user_id>', views.get_user_profile, name='user_profile'),
    path('<int:user_id>/update', views.update_profile, name='update_profile'),
    path('<int:user_id>/change-password', views.change_password, name='change_password'),
    path('<int:user_id>/stats', views.get_user_stats, name='user_stats'),
]
